CREATE TABLE [dbo].[Vedomost]
(
[Ik_ved] [int] NOT NULL IDENTITY(1, 1),
[Dd_exam] [datetime] NULL,
[cNumber_ved] [varchar] (50) COLLATE Cyrillic_General_CI_AS NULL,
[dD_vydano] [datetime] NULL,
[lClose] [bit] NOT NULL,
[lPriznak_napr] [bit] NOT NULL,
[lVnosn] [bit] NOT NULL CONSTRAINT [DF_Vedomost_lVnost] DEFAULT ((0)),
[Ik_grup] [int] NOT NULL,
[Itab_n] [int] NULL,
[Ik_vid_exam] [int] NOT NULL,
[ik_upContent] [int] NOT NULL,
[UserName] [varchar] (50) COLLATE Cyrillic_General_CI_AS NULL CONSTRAINT [DF_Vedomost_UserName] DEFAULT (suser_sname())
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Vedomost] WITH NOCHECK ADD CONSTRAINT [CheckVedomostDd_exam] CHECK (([Dd_exam]<=getdate()))
GO
ALTER TABLE [dbo].[Vedomost] WITH NOCHECK ADD CONSTRAINT [CheckVedomostdD_vydano] CHECK (([dD_vydano]<=(getdate()+(1))))
GO
ALTER TABLE [dbo].[Vedomost] ADD CONSTRAINT [PK_Vedomost0] PRIMARY KEY CLUSTERED  ([Ik_ved]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Vedomost] WITH NOCHECK ADD CONSTRAINT [FK_Vedomost0_Grup] FOREIGN KEY ([Ik_grup]) REFERENCES [dbo].[Grup] ([Ik_grup])
GO
ALTER TABLE [dbo].[Vedomost] WITH NOCHECK ADD CONSTRAINT [FK_Vedomost_Content_UchPl] FOREIGN KEY ([ik_upContent]) REFERENCES [dbo].[Content_UchPl] ([ik_upContent])
GO
ALTER TABLE [dbo].[Vedomost] ADD CONSTRAINT [FK_Vedomost_Prepod] FOREIGN KEY ([Itab_n]) REFERENCES [dbo].[Prepod] ([itab_n])
GO
